import { createElement } from '../vdom/create-element'

export function initRender(vm) {
    vm.$createElement = (a, b, c, d) => createElement(vm, a, b, c, d, true)
}
export function renderMixin(Vue) {
    //加载vue的时候初始化_render函数
    console.log('始化_render函数')
    Vue.prototype._render = function () {
        const vm = this
        const { render } = vm.$options
        //获取到render方法并调用
        console.log("获取到render方法并调用")
        let vnode;
        //vm.$createElement传给外边的render函数
        vnode = render.call(vm._renderProxy, vm.$createElement);
        return vnode
    }
}